package com.bcbim.smart_water.line.mapper;

import com.bcbim.common.sys.Code;
import com.bcbim.smart_water_interface.health.bo.UpdateFlawLatLonBO;
import com.bcbim.smart_water_interface.line.DO.PipelineLineDO;
import com.bcbim.smart_water_interface.line.DO.PipelineLineQuery;
import com.bcbim.smart_water_interface.line.VO.PipelineLineDataListVO;
import com.bcbim.smart_water_interface.line.VO.PipelineLineDataVO;
import com.bcbim.smart_water_interface.pipeManagement.dto.PipeLineExcelDownload;
import com.bcbim.smart_water_interface.pipeManagement.vo.PipeListCodeVO;
import com.bcbim.smart_water_interface.pipeManagement.vo.PipePointListAppVO;
import com.bcbim.smart_water_interface.pipeline.VO.PipelineLineVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description:
 * @Author XueHao
 * @Date 2021/8/9
 * @Version V1.0
 **/
@Mapper
public interface PipelineLineMapper {

    /**
     * @return List<PipelineLineDataListVO>
     * @Description 查询管线数据列表
     * @Author XueHao
     * @Date 2021/8/13
     */
    List<PipelineLineDataListVO> listPipelineLineData(PipelineLineQuery query);

    /**
     * @return int
     * @Description 查询管线数据列表条数
     * @Author XueHao
     * @Date 2021/8/13
     */
    int getPipelineLineDataListCount(PipelineLineQuery query);


    /**
     * @return PipelineLineDataVO
     * @Description 查询管线数据详情
     * @Author XueHao
     * @Date 2021/8/13
     */
    PipelineLineDataVO getPipelineLineData(String id);

    /**
     * @return int
     * @Description 删除管线数据
     * @Author XueHao
     * @Date 2021/8/13
     */
    int removePipelineLineData(String id);

    /**
     * @return int
     * @Description 新增管线数据
     * @Author XueHao
     * @Date 2021/8/13
     */
    int insertPipelineLineData(PipelineLineDO pipelineLineDO);

    /**
     * @return int
     * @Description 修改管线数据
     * @Author XueHao
     * @Date 2021/8/16
     */
    int updatePipelineLineData(PipelineLineDO pipelineLineDO);

    /**
     * 获取管线详情
     *
     * @param id 管线id
     * @return com.bcbim.pipeline_interface.pipeline.VO.PipelineLineVO
     * @author wxc
     * @date 2021/8/13  17:13
     */
    PipelineLineVO getPipelineLine(String id);

    /**
     * @return List<Code>
     * @Description 获取起始/终止点号
     * @Author XueHao
     * @Date 2021/8/25
     */
    List<Code> selectPointId(String code);

    /**
     * @return List<Code>
     * @Description 获取道路下拉
     * @Author wxc
     * @Date 2021/8/31
     */
    List<Code> getRolePull();

    /**
     * 获取全部管点的id和编号
     *
     * @return java.util.List<com.bcbim.common.sys.Code>
     * @author wxc
     * @date 2021/9/1  16:18
     */
    List<Code> getPipePointList();

    /**
     * 导入excel中的管线数据
     *
     * @param list 管线数据集合
     * @return int
     * @author wxc
     * @date 2021/9/1  10:14
     */
    int insertLinetList(List<PipeLineExcelDownload> list);

    /**
     * 获取需要导出的excel的数据通过id列表
     *
     * @param pipeLineIdList 管线id集合
     * @return java.util.List<com.bcbim.pipeline_interface.pipeManagement.dto.PipeLineExcelDownload>
     * @author wxc
     * @date 2021/9/1  19:06
     */
    List<PipeLineExcelDownload> getExcelLineList(List<String> pipeLineIdList);

    /**
     * 搜索管网编号模糊查询管线
     *
     * @param code 管网编号
     * @return java.util.List<com.bcbim.pipeline_interface.pipeManagement.vo.PipeListCodeVO>
     * @author wxc
     * @date 2021/10/14
     */
    List<PipeListCodeVO> getPipePointListByCode(String code);

    /**
     * 根据起始经度纬度 结束经度纬度 查询所属的管点
     *
     * @param startLat  开始纬度
     * @param startLong 开始经度
     * @param endLat    结束纬度
     * @param endLong   结束经度
     * @return java.util.List<com.bcbim.pipeline_interface.pipeManagement.vo.PipeLineListAppVO>
     * @author wxc
     * @date 2021/10/15
     */
    List<PipePointListAppVO> listPointByLatLongApp(@Param("startLat") Double startLat, @Param("startLong") Double startLong,
                                                   @Param("endLat") Double endLat, @Param("endLong") Double endLong);

    /**
     * @Description: 根据两个管井查询管线
     * @Param: startPoint
     * @Param: endPoint
     * @Return: String
     * @Author: ye
     * @Date: 2021/11/12
     */
    String getLineIdByPoints(@Param("startPoint") String startPoint, @Param("endPoint") String endPoint);

    /**
     * @Description: 查询材质码值code
     * @Param: material
     * @Return: string
     * @Author: ye
     * @Date: 2021/11/13
     */
    String getLineMaterial(String material);

    /**
     * @Description: 查询材质最大code
     * @Param:
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    Integer getMaxMaterialCode();

    /**
     * @param code
     * @Description: 添加材质码值
     * @Param:
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    void insertMaterial(Code code);

    /**
     * @param lineId
     * @Description: 查询管线起止点坐标
     * @Param: lineId
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    UpdateFlawLatLonBO getLineLatLon(String lineId);

    int checkLineCode(String code);

    void cleanLineCode(String code);

    int insertLine(PipeLineExcelDownload pipeLineExcelDownload);
}
